@using DotNetNuke.Modules.Forum;
@using DotNetNuke.Entities.Modules;
@using System.Collections;
@using System.Configuration;

@{    
    var user= (new ForumUserController()).GetForumUser(Int32.Parse(Request.Params["userId"]), false, -1, Dnn.Portal.PortalId);
    
    ModuleController controller = new ModuleController();
    Hashtable settings = controller.GetModuleSettings(Dnn.Module.ModuleID);
    
    int tabID = int.Parse((string)settings["TabID"]);
    int moduleID = int.Parse((string)settings["ModuleID"]);
    int pageSize = int.Parse((string)settings["PageSize"]);
}

@functions {
    public static string GetThreadsLink(int tabID, int userID)
    {
        return DotNetNuke.Modules.Forum.Utilities.Links.ContainerMyThreadsLink(tabID, userID);    
    }
    
    public List<ThreadInfo> LatestThreads(int userID, int moduleID, int pageSize)
    {
        var ctlSearch = new SearchController();       
        // filter, pageindex, pagesize, userid (this is for permissions, -1=public), forummoduleid, startdate, enddate, threadstatus
        var startDate = DateTime.Now.AddYears(-1);
        var endDate = DateTime.Now.AddYears(1);
        return ctlSearch.SearchGetResults(" AND (UserID IN (" + userID + ")) ", 0, pageSize, -1, moduleID, startDate, endDate, -1);
	}
    
    public string ThreadLink(int tabID, int forumID, int threadID)
    {
        return DotNetNuke.Modules.Forum.Utilities.Links.ContainerViewThreadLink(tabID, forumID, threadID);
	}
    
    
}
<body>
	<h3>Latest Discussion Participation</h3>
    <p>
        @foreach (ThreadInfo thread in LatestThreads(user.UserID, @moduleID, @pageSize))
        {
            <a href="@ThreadLink(@tabID, @thread.ForumID, @thread.ThreadID)">@thread.Subject</a>
			@thread.LastApprovedPost.CreatedDate<br />
        }
		<a href="@GetThreadsLink(@tabID, @user.UserID)">View more from @user.SiteAlias</a><br />
    </p>
	<p>
		<b>Total Posts: </b>@user.PostCount.ToString()<br />
	</p>
</body>